# Contributor: August Klein <amatcoder@gmail.com>
# Maintainer: August Klein <amatcoder@gmail.com>
pkgname=amule
_pkgname=aMule
pkgver=2.3.3
pkgrel=5
pkgdesc="eMule-like client for the eD2k and Kademlia networks"
url="https://www.amule.org/"
arch="all"
license="GPL-2.0-or-later"
makedepends="bison boost-dev crypto++-dev gd-dev geoip-dev libsm-dev libupnp-dev
	wxgtk3-dev"
options="!check" # unexpected end of file
subpackages="$pkgname-lang $pkgname-doc"
source="$_pkgname-$pkgver.tar.xz::https://downloads.sourceforge.net/project/amule/aMule/2.3.3/aMule-$pkgver.tar.xz
	fix-gcc11-include.patch
	"

builddir="$srcdir/$_pkgname-$pkgver"

build() {
	./configure \
		CPPFLAGS="$CPPFLAGS -Wno-unused-local-typedefs" \
		CFLAGS="$CFLAGS -fPIC" \
		CXXFLAGS="$CXXFLAGS -fPIC" \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--enable-alc \
		--enable-alcc \
		--enable-amule-daemon \
		--enable-amule-gui \
		--enable-amulecmd \
		--enable-ccache \
		--enable-geoip \
		--enable-optimize \
		--enable-upnp \
		--enable-webserver \
		--disable-debug \
		--with-boost \
		--with-wx-config=wx-config-gtk3
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
a5a80c5ddd1e107d92070c1d8e232c2762c4c54791abc067c739eef7c690062ed164dd7733808f80c762719261162aeb3d602308964dda2670a0bb059d87b74e  aMule-2.3.3.tar.xz
ce5e35ad33a188358dc311df06a2357dba52b5905f345dcba0fb44337ee1a1314579e918cb4e0cc60818a39d5c4678321262e9d6b1e17fe800fda55a5def1976  fix-gcc11-include.patch
"
